<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta http-equiv="Cache-Control" content="no-siteapp"/>
		<meta name="renderer" content="webkit" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
        <meta name="description" content="PlaneUI" />
        <meta name="keywords" content="PlaneUI" />
		<title>元素拖动 - PlaneUI 组件示例</title>

        <link rel="icon" type="image/png" href="favicon.png" />
        <link rel="stylesheet" href="../../dist/css/planeui.css" />
        <style> 
            .box {
                width: 200px;
                height: 200px; 
                padding: 90px 0;
                background: orange;
                color: #fff;
                text-align: center; 
                margin-right: 10px;
                position: absolute;
                top: 150px;
                left: 150px;
            }
            
            #container {
                width: 80%;
                height: 400px;
                overflow: hidden;
                margin: 600px auto 0 auto;
                position: relative;
                background: #eee;
            }
        </style>
	</head>
	<body>
		<div class="pui-layout" style="width:96%;">
            <br/>
            <h4 class="h4">元素拖动</h4> 
            <p><small>兼容情况： 支持 IE8+</small></p><br/>
            <div class="box pui-z-depth-2">Box 1（任意拖动）</div>
            <div class="box pui-z-depth-2" style="left:400px;background:red;">Box 2（水平拖动）</div>
            <div class="box pui-z-depth-2" style="top: 400px;left:400px;background:green;">Box 3（垂直拖动）</div>
            <div id="container">
                <div class="box pui-z-depth-2">Box 4（限定在窗口内任意拖动）</div>
                <div class="box pui-z-depth-2" style="background:blue">Box 5（限定在窗口内水平拖动）</div>
            </div>
        </div><br/>

        <!--[if (gte IE 9) | !(IE)]><!-->
		<script type="text/javascript" src="./js/jquery-2.1.1.min.js"></script>
        <!--<![endif]-->

		<!--[if lt IE 9]>
		<script type="text/javascript" src="./js/jquery-1.11.3.min.js"></script>
		<script type="text/javascript" src="./../../dist/js/planeui.patch.ie8.js"></script>
		<![endif]-->

		<!--[if lt IE 10]>
		<script type="text/javascript" src="./../../dist/js/planeui.patch.ie9.js"></script>
		<![endif]-->
		<script type="text/javascript" src="./../../dist/js/planeui.js"></script>
        <script type="text/javascript">
            $(function() {  
                $(".box").eq(0).draggable();
        
                $(".box").eq(1).draggable({
                    y : false
                });
        
                $(".box").eq(2).draggable({
                    x : false
                });
        
                //$(".box").eq(2).touchDraggable();
        
                $(".box").eq(3).draggable({
                    container : $("#container")
                });
        
                $(".box").eq(4).draggable({
                    container : $("#container"),
                    y : false
                });
            }); 
        </script> 
	</body>
</html>